<?php
	$lectId = $_GET['lectChosen'];

	include 'dbConnection.php';

	$result = mssql_query("EXECUTE GetCwiczenia $lectId");

	while($row = mssql_fetch_array($result)) {
		$prow = iconv("CP1250","utf-8",$row['prowadzacy']);
		$nazwa = $row['nazwa'];
		$godz = $row['godz_rozp'];
		$line = $nazwa.' '.$prow.' '.$godz;
		echo '<span class="lab" id="lab_'.$row['id'].'" onclick="selectCwiczenia('.$row['id'].')">'.$line.'</span>';
	}
	mssql_free_result($result);
	mssql_close($con);
?>
